package com.woniu.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.entity.Menu;
import com.woniu.mapper.MenuMapper;
import com.woniu.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hyl
 * @since 2022-08-28
 */
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IMenuService {
    @Autowired
    private MenuMapper menuMapper;
    @Override
    public void add(Menu menu) {
        menuMapper.insert(menu);
    }

    @Override
    public void delete(int id) {
        menuMapper.delete(id);
    }

    @Override
    public Menu getById(int id) {
        return menuMapper.getById(id);
    }

    @Override
    public List<Menu> getAll() {
        return menuMapper.getAll();
    }

    @Override
    public List<Menu> getByRoleId(int roleId) {
        return menuMapper.getByRoleId(roleId);
    }
}
